<div class="widget-box">             
    <div class="widget-title">
		<span class="icon">
			<i class="glyphicon <?php echo ((@$header_icon !='')?$header_icon:'glyphicon-th'); ?>"></i>
		</span>
		<h5><?php echo $header_title; ?></h5>
		<?php if(isset($showAdd) && $showAdd): ?>
		<div class="buttons alert-danger">
			<a id="add-event" href="<?php echo $this->url_add; ?>" data-original-title="<?php echo (isset($add_title)?$add_title:'Thêm mới');?>" class="btn tip-top"><i class="glyphicon glyphicon-plus"></i> <span class="text"><?php echo (isset($add_title)?$add_title:'Thêm mới');?></span></a>
		</div>
	<?php endif;?>
	</div>            

        <div class="widget-content nopadding">
            <table cellpadding="0" cellspacing="0" width="100%" class="<?php echo (isset($tableClass) && $tableClass!='')?$tableClass:'table table-bordered table-striped table-hover'?>">
                <thead>
                    <tr>   
                        <?php
                        foreach ($header as $k=>$v)
						{
                            echo '<th '.$v.'>' . $k . '</th>';
						}
                        if (@$showEdit || @$showDelete)
                            echo '<th style="width: 105px;">Action</th>';
                        ?>                                    
                    </tr>
                </thead>
                <tbody>
                    <?php
                    foreach ($datas as $keys => $vals) {
                        if ($ID >= 0) {
                            $mID = $vals[$ID];
                            unset($vals[$ID]);
                        } else {
                            $mID = 0;
                        }
                        echo '<tr id="' . $mID . '">';

                        foreach ($vals as $key => $val)
                            echo '<td>' . $val . '</td>';
                        if (@$showEdit || @$showDelete) {
                            echo '<td>';
                            if (@$showEdit)
                                echo '<a href="' . $this->url_edit . $mID . '" class="btn btn-primary btn-mini tip-top" data-original-title="Edit">Edit</a>';

                            if (@$showDelete)
								echo ' <a href="#delete" class="btn btn-danger btn-mini delete tip-top" data-toggle="modal" rel_url="'.$this->url_delete.$mID.'" rel_id="'.$mID.'" data-original-title="Delete">Delete</a>';

                            echo '</td>';
                        }
						 echo '</tr>';
                    }
                    ?>
					
					  <tr>
                        <td colspan="<?php echo (isset($vals)) ? count($vals) + 2 : 2; ?>"><?php echo @$this->pagination->create_links(); ?></td>
                    </tr>
                </tbody>
                 
            </table>
        </div>
                              

</div>
